<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AlterBaseSupplier extends Migrator
{
      public function up(){
            $this->table("base_supplier")
                ->changeColumn('created_at','datetime', ['default' =>'CURRENT_TIMESTAMP','comment'=>"创建时间"])
                ->changeColumn('updated_at','datetime', ['default' =>'CURRENT_TIMESTAMP','comment'=>"更新时间"]);
      }
      public function down()
      {
             $sql=<<<SQL
alter table `base_supplier` modify `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
modify `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间';
SQL;
          $this->execute($sql);
      }
}
